<template>
  <div>
    <div class="ChooseSchool">
      <div class="ChooseSchool_header">
        <div class="centre">
          <router-link
            to="index"
            tag="img"
            src="https://huizeimg.oss-cn-shenzhen.aliyuncs.com/huize/update/156222927235720190704163413.jpg"
            alt
          ></router-link>
          <span>挑选学校</span>
        </div>
      </div>
      <div class="ChooseSchool_nav">
        <h3 class="centre nav">
          <router-link to="/" tag="span">首页</router-link>>
          <router-link to="/volunteer" tag="span">填报志愿</router-link>>
          <span>挑选</span>
        </h3>
      </div>
      <div class="ChooseSchool_list">
        <div class="list_header centre">
<<<<<<< HEAD
          <!-- <div class="list_header_left">
=======
          <div class="list_header_left">
>>>>>>> 314b442cce11d658746227581b0160373004c345
            <el-dropdown split-button type="primary">
              选择排列方式
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item command="2017">分数最低</el-dropdown-item>
                <el-dropdown-item command="2018">排名最低</el-dropdown-item>
                <el-dropdown-item command="2019">2019</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>

            <div class="Choose_botton" v-on:click="Choose = 1">
              <span>更多筛选</span>
              <i class="el-icon-s-operation"></i>
            </div>
<<<<<<< HEAD
          </div>-->
          <div></div>
          <div class="list_header_right">
            <router-link tag="span" to="/Alternative" v-if="Alternative">
              <el-button type="warning">
                <i class="iconfont">&#xe60a;</i>
                备选志愿(进入下一步)
              </el-button>
            </router-link>

=======
          </div>
          <div class="list_header_right">
            <el-button type="warning" v-if="Alternative">
              <router-link to="/Alternative" tag="div">
                <i class="iconfont">&#xe60a;</i> 备选志愿(进入下一步)
              </router-link>
            </el-button>
>>>>>>> 314b442cce11d658746227581b0160373004c345
            <el-button type="primary" v-else>
              <i class="iconfont">&#xe60a;</i> 备选志愿(进入下一步)
            </el-button>
          </div>
        </div>
        <div class="ChooseSchool_More centre" v-show="Choose == 1">
          <div class="ChooseSchool_More_header">
            <h3 v-if="MoreT == 0" v-on:click=" MoreT = 1">
              筛选更多
              <i class="iconfont">&#xe733;</i>
            </h3>
            <h3 class="h3i" v-if="MoreT == 1" v-on:click=" MoreT = 0">
              收起更多
              <i class="iconfont">&#xe733;</i>
            </h3>
          </div>
          <div class="More_Choose">
            <ul>
              <li>
                <span>批次:</span>
                <ul>
                  <li>本科一批次</li>
                  <li>本科二批次</li>
                  <li>专科批</li>
                </ul>
              </li>
              <li>
                <span>著名大学:</span>
                <ul>
                  <li>不限</li>
                  <li>985</li>
                  <li>211</li>
                </ul>
              </li>
              <li>
                <span>大学性质:</span>
                <ul>
                  <li>不限</li>
                  <li>民办</li>
                  <li>公办</li>
                </ul>
              </li>
            </ul>
          </div>
          <div class="More_Chooses" v-show="MoreT == 1">
            <ul>
              <li>
                <span>大学类型:</span>
                <ul v-if="More == 0">
                  <li v-for="(item ,index ) in tyle" :key="index">{{item}}</li>
                </ul>
                <ul v-if="More == 1">
                  <li v-for="(item ,index ) in tyles" :key="index">{{item}}</li>
                </ul>
                <div class="More_blick" v-if="More == 0" v-on:click=" More = 1">
                  更多
                  <i class="iconfont">&#xe733;</i>
                </div>
                <div class="More_nane" v-if="More == 1" v-on:click=" More = 0">
                  收起
                  <i class="iconfont">&#xe733;</i>
                </div>
              </li>
            </ul>
          </div>
          <div class="More_Chooses" v-show="MoreT == 1">
            <ul>
              <li>
                <span>地区:</span>
                <ul v-if="MoreS == 0">
                  <li v-for="(item ,index ) in province" :key="index">{{item}}</li>
                </ul>
                <ul v-if="MoreS == 1">
                  <li v-for="(item ,index ) in provinces" :key="index">{{item}}</li>
                </ul>
                <div class="More_blick" v-if="MoreS == 0" v-on:click=" MoreS = 1">
                  更多
                  <i class="iconfont">&#xe733;</i>
                </div>
                <div class="More_nane" v-if="MoreS == 1" v-on:click=" MoreS = 0">
                  收起
                  <i class="iconfont">&#xe733;</i>
                </div>
              </li>
            </ul>
          </div>
          <div class="More_Chooses_bottom">
            <div v-on:click="nane = 0">
              收起全部
              <i class="iconfont" v-on:click="Choose = 0">&#xe733;</i>
            </div>
          </div>
        </div>
        <div class="schoolname centre">
          <ul>
            <li v-for=" tiem   in SchoolList" :key="tiem.id">
              <dir class="naems_header">
                <img :src="tiem.logoUrl" alt />
                <span>{{tiem.yuanxiaomingcheng}}</span>
              </dir>
              <div class="uniCity">{{tiem.uniCity}}</div>
              <div class="names_centent">
                <p>
                  录取的概率
<<<<<<< HEAD
                  <i class="red" v-if=" VIP  > 0 ">({{tiem.admissionOdds}}%)</i>
=======
                  <i class="red" v-if=" VIP != 0 ">({{tiem.admissionOdds}}%)</i>
>>>>>>> 314b442cce11d658746227581b0160373004c345
                  <i v-else>(VIP 可见)</i>
                </p>
                <p>
                  {{tiem.year}}年最低分
                  <span>{{tiem.minScore}}</span>
                </p>
                <p>
                  {{tiem.year}}年最低排名
                  <span>{{tiem.minRanking}}</span>
                </p>
                <p>
                  {{tiem.year}}年招生
                  <span>{{tiem.planNum}}人</span>
                </p>
              </div>
              <div class="names_button">
                <el-button
                  type="primary"
                  v-if="schoolListID.indexOf(tiem.schoolId) == -1   &&  MySchoolIDList.indexOf(tiem.schoolId) == -1  "
                  @click="addMajor(tiem.schoolId,tiem.id , tiem.schoolName ,tiem)"
                >
                  <i class="el-icon-plus"></i> 备选专业
                </el-button>
                <el-button
                  type="warning"
                  v-else
                  @click="addMajor(tiem.schoolId,tiem.id , tiem.schoolName,tiem)"
                >
<<<<<<< HEAD
                  <i class="el-icon-check"></i> 已加备选
=======
                  <i class="el-icon-check"></i> 以加备选
>>>>>>> 314b442cce11d658746227581b0160373004c345
                </el-button>
              </div>
            </li>
          </ul>
        </div>

        <div class="list_bottom">
<<<<<<< HEAD
          <div class="button" v-if="totalCount  <= pageSize  ">没有更多</div>
          <div v-else class="button" @click="addPageNow()">查看更多</div>
=======
          <div class="button" @click="addPageNow()">查看更多</div>
>>>>>>> 314b442cce11d658746227581b0160373004c345
        </div>
      </div>
      <router-view></router-view>
    </div>
    <div class="Write" v-if="WriteType ==  1 ">
      <div class="Write_major">
        <div class="name_lists_header">
          <div class="Choose_Major">
<<<<<<< HEAD
            <i class="el-icon-close" @click="CutNone()"></i>
=======
            <i class="el-icon-close" v-on:click="WriteType =  0"></i>
>>>>>>> 314b442cce11d658746227581b0160373004c345
            <span>请将您想上的专业添加入备选</span>
            <div @click="AddMajorAllId">完成</div>
          </div>
        </div>
        <div class="schools_name">{{schoolName}}</div>
        <div class="name_lists_bottom">
          <div class="lists_bottom">
            <ul>
<<<<<<< HEAD
              <span v-if="majorList.length != 0 ">
                <li v-for=" (list  , index) in majorList" :key="index">
                  <div class="lists_bottom_left">
                    <h3>{{list.majIntroduce}}</h3>
                    <div class="lists_bottom_left_bottom">
                      <p>
                        <!-- {{schoolYear}}年录取最低排名 -->
                        18年录取最低排名
                        <span>{{list.minRanking != '' ? list.minRanking : "暂无数据" }}</span>
                      </p>
                      <p>
                        {{schoolYear}}年招生
                        <span>{{list.planNum != '' ? list.planNum : "暂无数据"}}人</span>
                      </p>
                      <p>
                        18年录取最低分
                        <span>{{list.minScore != '' ? list.minScore : "暂无数据"}}</span>
                      </p>
                    </div>
                  </div>
                  <div class="lists_bottom_button">
                    <el-button
                      type="primary"
                      v-if="MyMajorIDArr.indexOf(list.majorAllId) == -1 "
=======
              <li v-for=" (list  , index) in majorList" :key="index">
                <div class="lists_bottom_left">
                  <h3>{{list.majIntroduce}}</h3>
                  <div class="lists_bottom_left_bottom">
                    <p>
                      {{schoolYear}}年录取最低排名
                      <span>{{list.minRanking != '' ? list.minRanking : "null" }}</span>
                    </p>
                    <p>
                      {{schoolYear}}年招生人数
                      <span>{{list.planNum != '' ? list.planNum : "null"}}</span>
                    </p>
                    <p>
                      {{schoolYear}}年录取最低分
                      <span>{{list.minScore != '' ? list.minScore : "null"}}</span>
                    </p>
                  </div>
                </div>
                <div class="lists_bottom_button">
                  <span v-if="MySchoolIDList.indexOf(schoolID) == -1">
                    <el-button
                      type="primary"
                      @click="addMjaorID(list.majorAllId,list.admissionMajorId ,index) "
                    >
                      <i class="el-icon-plus"></i> 备选专业
                    </el-button>
                  </span>
                  <span v-else>
                    <el-button
                      type="primary"
                      v-if="majorAllIds.indexOf(list.majorAllId) == -1 && majorIDs.indexOf(list.majorAllId) == -1 "
>>>>>>> 314b442cce11d658746227581b0160373004c345
                      @click="addMjaorID(list.majorAllId,list.admissionMajorId ,index) "
                    >
                      <i class="el-icon-plus"></i> 备选专业
                    </el-button>
                    <el-button
                      type="warning"
                      v-else
                      @click="cutMjaorID(list.majorAllId,list.admissionMajorId) "
                    >
<<<<<<< HEAD
                      <i class="el-icon-check"></i> 已加备选
                    </el-button>
                  </div>
                </li>
              </span>
              <span v-else>
                <li>
                  <div>暂无数据</div>
                </li>
              </span>
=======
                      <i class="el-icon-check"></i> 以加备选
                    </el-button>
                  </span>
                </div>
              </li>
>>>>>>> 314b442cce11d658746227581b0160373004c345
            </ul>
          </div>
        </div>
      </div>
    </div>
    <div class="Write" v-if="WriteType ==  2 ">
      <div class="Write_major">
        <div class="name_lists_header">
          <router-link to="/ChooseSchool" tag="div" class="Choose_Major">
            <i class="el-icon-close"></i>
            <span>请将您想上的专业添加入备选</span>
          </router-link>
        </div>
        <div class="schools_name">北京大学</div>
        <div class="name_lists_bottom">
          <div class="lists_bottom">
            <ul>
              <li>
                <div class="lists_bottom_left">
                  <h3>电子信息类</h3>
                  <div class="lists_bottom_left_bottom">
                    <p>
                      18年录取最低排名
                      <span>788880</span>
                    </p>
                    <p>
                      18年招生人数
                      <span>78</span>
                    </p>
                    <p>
                      年录取最低分
                      <span>554</span>
                    </p>
                  </div>
                </div>
                <div class="lists_bottom_button">
                  <el-button type="primary">
                    <i class="el-icon-plus"></i> 备选专业
                  </el-button>
                </div>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
<<<<<<< HEAD
import { publicDecrypt } from "crypto";
=======

>>>>>>> 314b442cce11d658746227581b0160373004c345
export default {
  name: "ChooseSchool",
  data() {
    return {
      schoolListID: [],
      majorListID: [],
      WriteType: 0,
      Choose: 0,
      MoreT: 0,
      More: 0,
      MoreS: 0,
<<<<<<< HEAD
      pageSize: 8,
=======
      pageSize: 0,
>>>>>>> 314b442cce11d658746227581b0160373004c345
      schoolName: "",
      majorList: [],
      SchoolList: [],
      ojdID: {},
      schoolID: "",
      schollIds: "",
      MajorIds: [],
<<<<<<< HEAD
      VIP: "",
=======
      VIP: localStorage.getItem("vip"),
>>>>>>> 314b442cce11d658746227581b0160373004c345
      majorAllIds: [],
      ojdmajor: {},
      Alternative: false,
      schoolNumber: "",
      majorNumber: "",
      MySchoolIDList: [],
<<<<<<< HEAD

      majorIDs: [],
      lListID: [],
      schoolYear: "",

      totalCount: "",
      MySchoolList: "",
      MyMajorIDArr: "",
=======
      majorIDLists: [],
      majorIDs: [],
      lListID: [],
      schoolYear: "",
>>>>>>> 314b442cce11d658746227581b0160373004c345
      tyle: [
        " 不限",
        " 综合",
        " 理工",
        " 财经",
        " 师范",
        " 语言",
        " 政法",
        " 民族",
        " 农林",
        " 医药"
      ],
      tyles: [
        " 综合",
        " 理工",
        " 财经",
        " 师范",
        " 语言",
        " 政法",
        " 民族",
        " 农林",
        " 医药",
        " 艺术",
        " 体育",
        " 军事"
      ],

      province: [
        "不限",
        "北京市",
        "天津市",
        "上海市",
        "重庆市",
        "河北省",
        "山西省",
        "辽宁省",
        "吉林省"
      ],
      provinces: [
        "不限",
        "北京市",
        "天津市",
        "上海市",
        "重庆市",
        "河北省",
        "山西省",
        "辽宁省",
        "吉林省",
        "黑龙江省",
        "江苏省",
        "浙江省",
        "安徽省",
        "福建省",
        "江西省",
        "山东省",
        "河南省",
        "湖北省",
        "湖南省",
        "广东省",
        "海南省",
        "四川省",
        "贵州省",
        "云南省",
        "陕西省",
        "甘肃省",
        "青海省",
        "台湾省",
        "内蒙古自治区",
        "广西壮族自治区",
        "西藏自治区",
        "宁夏回族自治区",
        "新疆维吾尔自治区",
        "香港特别行政区",
        "澳门特别行政区"
      ]
    };
  },
  methods: {
    open3(s) {
      this.$message.error(s);
    },
<<<<<<< HEAD
    open1(g) {
      this.$message({
        message: g,
        type: "success"
      });
    },
    //关闭添加专业
    CutNone() {
      this.MajorIds = [];
      this.WriteType = "";
      this.MyMajorIDArr = [];
    },
    //获取符合的学校
    getSchool() {
      let userInfo = JSON.parse(localStorage.getItem("userInfo"));
      this.VIP = userInfo.userEntity.vip;
=======
    getSchool() {
>>>>>>> 314b442cce11d658746227581b0160373004c345
      if (this.$route.params.type == 0) {
        this.$ajax({
          method: "POST",
          url: "/api/volunteer/SchoolApplicationTest",
          data: {
            address: 0,
            batch: this.$route.params.batch,
            category: 0,
            keyOne: 0,
            pageNow: 1,

<<<<<<< HEAD
            pageSize: this.pageSize,
=======
            pageSize: 8 + this.pageSize,
>>>>>>> 314b442cce11d658746227581b0160373004c345
            schoolPrivate: 0,
            schoolType: 0,
            score: 0,
            type: this.$route.params.id
          },
          success: res => {
            if (res.data.code == 0) {
              this.SchoolList = res.data.data.list;
              var lists = res.data.data.list;
              var schoolListID = [];
<<<<<<< HEAD
              this.totalCount = res.data.data.totalCount;

=======
>>>>>>> 314b442cce11d658746227581b0160373004c345
              lists.forEach(function(v) {
                schoolListID.push(v.schoolId);
                return schoolListID;
              });
              this.lListID = schoolListID;
              var rs = false;

              for (var i = 0; i < this.MySchoolIDList.length; i++) {
                for (var j = 0; j < schoolListID.length; j++) {
                  if (this.MySchoolIDList[i] == schoolListID[j]) {
                    rs = true;

                    break;
                    return rs;
                  }
                }
              }

              this.Alternative = rs;
            }
          }
        });
      } else {
        var majorListID = this.$route.params.type;
<<<<<<< HEAD
        var list = majorListID.split(",");
=======
>>>>>>> 314b442cce11d658746227581b0160373004c345

        this.$ajax({
          method: "POST",
          url: "/api/voluntary/majorFirstSchoolList",
          data: {
<<<<<<< HEAD
            majorAllIds: list,
            batch: this.$route.params.batch,
            type: this.$route.params.id,
=======
            majorAllIds: majorListID,
            batch: "0",
            type: 2,
>>>>>>> 314b442cce11d658746227581b0160373004c345
            pageNow: 1
          },
          success: res => {
            if (res.data.code == 0) {
              this.SchoolList = res.data.data.list;
              var lists = res.data.data.list;
              var schoolListID = [];
              lists.forEach(function(v) {
                schoolListID.push(v.schoolId);
                return schoolListID;
              });
              this.lListID = schoolListID;
              var rs = false;

              for (var i = 0; i < this.MySchoolIDList.length; i++) {
                for (var j = 0; j < schoolListID.length; j++) {
                  if (this.MySchoolIDList[i] == schoolListID[j]) {
                    rs = true;

                    break;
                    return rs;
                  }
                }
              }

              this.Alternative = rs;
            } else {
              this.open3(res.data.msg);
            }
          }
        });
      }
    },
    addPageNow() {
      this.pageSize += 8;
      this.getSchool();
    },
<<<<<<< HEAD
    // 获取学校专业
=======
>>>>>>> 314b442cce11d658746227581b0160373004c345
    addMajor(ID, id, SchoolName, obj) {
      this.schoolYear = obj.year;
      this.schollIds = id;
      this.WriteType = 1;
      this.schoolName = SchoolName;

      this.schoolID = ID;
<<<<<<< HEAD
      var Arr = [];
      this.MySchoolList.map(S => {
        if (S.schoolId == ID) {
          S.subjectVoList.map(M => {
            Arr.push(parseInt(M.majorAllId));
            return Arr;
          });
        }
      });
      this.MyMajorIDArr = Arr;
=======
>>>>>>> 314b442cce11d658746227581b0160373004c345
      this.$ajax({
        method: "GET",
        url: "/api/volunteer/voluntaryTest1/" + ID,

        success: res => {
          if (res.data.code == 0) {
            this.majorList = res.data.data;
          } else {
          }
        }
      });
    },
<<<<<<< HEAD
    //添加专业(添加更多)
    addMjaorID(ID, id, index) {
      if (this.MyMajorIDArr.length > this.majorNumber - 1) {
        this.open3("专业不能超过" + this.schoolNumber);
      } else {
        if (id != "") {
          this.MajorIds.push(id);
        } else {
          this.MajorIds.push("string");
        }

        this.MyMajorIDArr.push(ID);
      }
    },
    // 删除专业(已添加)
    cutMjaorID(ID, id) {
      let index = this.MyMajorIDArr.indexOf(ID);
      let majorIndex = this.majorIDs.indexOf(ID);
      console.log(majorIndex);
      if (index != -1) {
        this.MyMajorIDArr.splice(index, 1);
=======
    addMjaorID(ID, id, index) {
      this.MySchoolIDList.push(this.schoolID);
      if (id != "") {
        this.MajorIds.push(id);
      } else {
        this.MajorIds.push("string");
      }

      this.majorAllIds.push(ID);
    },
    cutMjaorID(ID, id) {
      let index = this.majorAllIds.indexOf(ID);
      let majorIndex = this.majorIDs.indexOf(ID);
      console.log(majorIndex);
      if (index != -1) {
        this.majorAllIds.splice(index, 1);
>>>>>>> 314b442cce11d658746227581b0160373004c345
      }

      let indexs = this.MajorIds.indexOf(id);
      if (indexs != -1) {
        this.MajorIds.splice(index, 1);
      }
      if (majorIndex != -1) {
        this.majorIDs.splice(majorIndex, 1);
        console.log(this.majorIDs);
      }
    },
<<<<<<< HEAD

    //完成添加专业
    AddMajorAllId() {
      if (this.MyMajorIDArr.length > this.majorNumber) {
        this.open3("专业不能超过" + this.schoolNumber);
      } else {
        this.MySchoolIDList.push(this.schoolID);
        let addIDs = this.MyMajorIDArr;
        let addID = addIDs.join();
        let NewMajorAllIds = addID.replace(/\[.*?\]/g, "");
        var ojdIDs = {};
        var ojdIDs = NewMajorAllIds;
        this.ojdID = ojdIDs;
        let addids = this.MajorIds;
        let addid = addids.join();
        let NewIds = addid.replace(/\[.*?\]/g, "");
        var ojdids = {};
        var ojd = NewIds;
        this.ojdmajor = ojd;
        this.$ajax({
          method: "POST",
          url: "/api/volunteer/save/alternative",
          data: {
            batch: this.$route.params.batch,
            admissionDetailsId: this.schollIds,
            admissionMajorId: this.ojdmajor,
            alternativeType: 1,

            majorAllIds: this.ojdID,
            schoolId: this.schoolID
          },
          success: res => {
            if (res.data.code == 0) {
              this.open1("保存" + res.data.msg);
              this.Alternative = true;
              this.schoolListID.push(this.schoolID);
              this.schoolID = "";
              this.majorListID.push(this.ojdID);
              this.ojdID = "";
              this.ojdmajor = "";
              this.WriteType = 0;
              this.MyMajorIDArr = [];
              this.getSchoolLsit();
            } else {
              this.open3(res.data.msg);
            }
          }
        });
      }
    },
    // 获取数量限制与已添加学校
    getMajorNum() {
      //限制专业数
=======
    AddMajorAllId() {
      if (this.lListID.length > this.schoolNumber) {
        this.open3("学校不能超过" + this.schoolNumber);
      } else {
        if (this.majorAllIds.length > this.majorNumber) {
          this.open3("专业不能超过" + this.schoolNumber);
        } else {
          let addIDs = this.majorAllIds;
          let addID = addIDs.join();
          let NewMajorAllIds = addID.replace(/\[.*?\]/g, "");
          var ojdIDs = {};
          var ojdIDs = NewMajorAllIds;
          this.ojdID = ojdIDs;
          let addids = this.MajorIds;
          let addid = addids.join();
          let NewIds = addid.replace(/\[.*?\]/g, "");
          var ojdids = {};
          var ojd = NewIds;
          this.ojdmajor = ojd;
          this.$ajax({
            method: "POST",
            url: "/api/volunteer/save/alternative",
            data: {
              batch: this.$route.params.batch,
              admissionDetailsId: this.schollIds,
              admissionMajorId: this.ojdmajor,
              alternativeType: 1,

              majorAllIds: this.ojdID,
              schoolId: this.schoolID
            },
            success: res => {
              if (res.data.code == 0) {
                this.Alternative = true;
                this.schoolListID.push(this.schoolID);
                this.schoolID = "";
                this.majorListID.push(this.ojdID);
                this.ojdID = "";
                this.ojdmajor = "";
                this.WriteType = 0;
                this.majorAllIds = [];
              }
            }
          });
        }
      }
    },
    getMajorNum() {
>>>>>>> 314b442cce11d658746227581b0160373004c345
      this.$ajax({
        method: "GET",
        url: "/api/volunteerNum/schoolNum/" + this.$route.params.batch,

        success: res => {
          if (res.data.code == 0) {
<<<<<<< HEAD
            if (res.data.data.majorNumber == "") {
              this.majorNumber = res.data.data.maxNumber;
              this.schoolNumber = res.data.data.maxNumber;
            } else {
              this.majorNumber = res.data.data.majorNumber;
              this.schoolNumber = res.data.data.schoolNumber;
            }
=======
            this.majorNumber = res.data.data.majorNumber;
            this.schoolNumber = res.data.data.schoolNumber;
>>>>>>> 314b442cce11d658746227581b0160373004c345
          } else {
            this.open3(res.data.msg);
          }
        }
      });
<<<<<<< HEAD
      //已添加学校
      this.getSchoolLsit();
    },
    getSchoolLsit() {
=======
>>>>>>> 314b442cce11d658746227581b0160373004c345
      this.$ajax({
        method: "POST",
        url: "/api/volunteer/voluntaryTest?batch=" + this.$route.params.batch,

        success: res => {
          if (res.data.code == 0) {
<<<<<<< HEAD
            this.MySchoolList = res.data.data;
            for (let index in res.data.data) {
              this.MySchoolIDList.push(res.data.data[index].schoolId);
            }
=======
            for (let index in res.data.data) {
              this.MySchoolIDList.push(res.data.data[index].schoolId);
              this.majorIDLists.push(res.data.data[index].subjectVoList);
            }
            var arr = [];
            this.majorIDLists.forEach(function(v) {
              v.forEach(function(s) {
                var majorAllIds = s.majorAllId;

                arr.push(parseInt(majorAllIds));
                return arr;
              });
            });
            this.majorIDs = arr;
>>>>>>> 314b442cce11d658746227581b0160373004c345

            // for ( let  majorids    in  ){

            //   console.log(majorids[index])
            // }
          } else {
            this.open3(res.data.msg);
          }
        }
      });
    }
  },
  beforeCreate() {
    this.$nextTick(() => {
      this.getSchool();
      this.getMajorNum();
    });
  }
};
</script>

<style lang="scss">
.ChooseSchool {
  .ChooseSchool_header {
    padding: 10px 0;
    img {
      width: 48px;
    }
    span {
      font-size: 22px;
      color: #5e5e5e;
      padding-left: 24px;
      position: relative;
      top: -18px;
    }
  }
  .ChooseSchool_nav {
    background: #f6f6f6;
    .nav {
      color: #757575;
      padding: 26px 0;

      span {
        cursor: pointer;
      }
    }
  }
  .ChooseSchool_list {
    background: #f6f6f6;
    padding-bottom: 100px;

    .list_header {
      background: #fff;
      border-radius: 10px;
      padding: 16px 0;
      display: flex;
      justify-content: space-between;
      .list_header_left {
        padding-left: 70px;
        display: flex;
        .el-button-group {
          margin-right: 32px;
        }
        .el-button--primary {
          color: #818181;
          background: #f8f8f8;
          border-color: #f8f8f8;
          span {
            width: 78px;
          }
        }
        .el-dropdown .el-dropdown__caret-button::before {
          background: #f8f8f8;
        }
        .el-dropdown .el-dropdown__caret-button:hover {
          background: #f8f8f8;
          height: 100%;
        }
        .Choose_botton {
          color: #818181;
          width: 168px;
          height: 40px;
          overflow: hidden;
          line-height: 40px;
          background: #f8f8f8;
          display: flex;
          justify-content: space-between;
          align-items: center;
          border-radius: 4px;
          span {
            padding-left: 18px;
          }
          i {
            padding-right: 8px;
            font-size: 12px;
          }
        }
      }
      .list_header_right {
        padding-right: 32px;
      }
    }
    .ChooseSchool_More {
      background: #ffffff;
      border-radius: 10px;
      padding: 26px 0;
      margin-top: 12px;
      overflow: hidden;
      .ChooseSchool_More_header {
        display: flex;
        justify-content: flex-end;
        h3 {
          color: #414141;
          font-size: 14px;
          cursor: pointer;
          text-align: right;
          padding: 20px 76px;
          i {
            font-size: 10px;
          }
        }
        .h3i {
          display: flex;
          i {
            display: block;
            transform: rotate(180deg);
          }
        }
      }
      .More_Choose {
        overflow: hidden;
        > ul {
          padding-left: 30px;

          > li {
            display: flex;
            margin-bottom: 22px;
            span {
              display: block;
              color: #414141;
              width: 100px;
            }
            ul {
              display: flex;
              color: #a3a3a3;
              cursor: pointer;
              li {
                margin-right: 48px;
              }
            }
          }
        }
      }
      .More_Chooses {
        display: flex;
        overflow: hidden;
        > ul {
          padding-left: 30px;

          > li {
            display: flex;
            margin-bottom: 22px;
            span {
              display: block;
              color: #414141;
              width: 100px;
            }
            ul {
              width: 814px;
              display: flex;
              color: #a3a3a3;
              cursor: pointer;
              flex-wrap: wrap;
              li {
                margin-bottom: 20px;
                margin-right: 48px;
              }
            }
            div {
              color: #414141;
              font-size: 14px;
              cursor: pointer;
              text-align: right;
              margin-left: 102px;
              i {
                font-size: 12px;
                padding-left: 12px;
              }
            }
            .More_nane {
              display: flex;
              .iconfont {
                display: block;
                height: 12px;
                padding-right: 12px;
                transform: rotate(180deg);
              }
            }
          }
        }
      }
      .More_Chooses_bottom {
        display: flex;
        justify-content: center;
        div {
          cursor: pointer;
          padding: 12px;
          margin: 0 auto;
          display: flex;
          color: #757575;
          i {
            padding: 0 10px;
            font-size: 14px;
            display: block;
            transform: rotate(180deg);
          }
        }
      }
    }

    .schoolname {
      ul {
        display: flex;

        flex-wrap: wrap;
        li {
          border-radius: 10px;
          display: block;
          background: #fff;
          padding: 30px;
          margin: 24px 0;
          margin-right: 44px;
          .naems_header {
            padding: 0;
            margin: 0;
            padding-bottom: 12px;
            width: 200px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            img {
              width: 20px;
              height: 20px;
              margin-right: 6px;
              position: relative;
              top: 4px;
            }
          }
          .uniCity {
            padding: 12px 0;
            padding-left: 26px;
            color: #414141;
            font-size: 14px;
          }
          .names_centent {
            padding-left: 26px;

            p {
              color: #757575;
              font-size: 12px;
              padding-bottom: 12px;
              i {
                color: #f7ce38;
              }
              .red {
                color: red;
              }
              span {
                color: #414141;
              }
            }
          }
        }
      }

      li:nth-child(4n) {
        margin-right: 0;
      }
    }
    .list_bottom {
      padding: 20px;
      margin: 0 auto;

      .button {
        color: #959595;
        width: 100px;
        text-align: center;
        margin: 0 auto;
        cursor: pointer;
      }
    }
  }
}
.Write {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba($color: #000000, $alpha: 0.4);
  z-index: 1100;
  .Write_major {
    width: 480px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    height: 550px;
    margin: 0 auto;
    margin-top: 30px;
    .schools_name {
      color: #757575;

      background: #f8f8f8;
      padding: 12px 18px;
    }
    .name_lists_header {
      padding-top: 34px;
      .Choose_Major {
        padding: 0 18px;
        display: flex;

        div {
          color: rgb(67, 149, 243);
          padding: 10px;
          font-size: 18px;
          margin-left: 52px;
          cursor: pointer;
        }
        span {
          font-size: 18px;
          padding: 12px 0;
        }
        i {
          color: #c8c8c8;
          font-size: 20px;
          padding: 12px 12px;
        }
      }
    }
    .name_lists_bottom {
      width: 100%;
      height: 100%;
      overflow: auto;
      padding-right: 50px;

      .lists_bottom {
        width: 200px;
        padding-bottom: 130px;
        > ul {
          li {
            display: block;
            width: 340%;
            display: flex;
            padding-left: 44px;
            padding-top: 26px;
            padding-bottom: 10px;
            border-bottom: 8px #f8f8f8 solid;
            .lists_bottom_left {
              width: 280px;
              h3 {
                line-height: 28px;
                padding-bottom: 14px;
              }
              .lists_bottom_left_bottom {
                display: flex;
                justify-content: space-between;
                flex-wrap: wrap-reverse;
                font-size: 10px;
                color: #757575;
                p {
                  line-height: 26px;
                  span {
                    color: #414141;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
</style>